<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles"
	prefix="tiles"%>

<rich:panel header="#{messages['rci.booking.entry.mgmt.menu']}">
	<h:panelGrid>
		<h:outputText value="#{errorBean.errorMessage}" styleClass="error"></h:outputText>
	</h:panelGrid>
	
	<h:panelGrid width="100%">
	    <h:outputText value="#{messages['rci.booking.entry']}" styleClass="sub_header" />
	</h:panelGrid>
	
	<h:panelGrid width="100%" columns="1">
	    <h:panelGroup>
			<rich:dataTable id="data" var="rciBookingEntry" value="#{adminRCIBean.rciBookingEntryList}" rows="20" width="99%">
				<rich:column style="text-align:center;width:5%;" >
					<f:facet name="header">
						<h:selectBooleanCheckbox id="chkAll" onclick="checkAll(this.form,this)" ></h:selectBooleanCheckbox>
					</f:facet>
					<h:selectBooleanCheckbox rendered="#{rciBookingEntry.status=='Pending'}" id="chk" value="#{rciBookingEntry.markAsSelect}"></h:selectBooleanCheckbox>
					<h:outputText rendered="#{rciBookingEntry.status!='Pending'}"></h:outputText>
				</rich:column>
				
				<rich:column style="text-align:center;width:5%;">
					<f:facet name="header">
						<h:outputText value="#{messages['year']}"></h:outputText>
					</f:facet>
				
					<h:commandLink action="#{adminRCIBean.navUpdateRCIBookingEntryAction}" actionListener="#{adminRCIBean.navUpdateRCIBookingEntryActionEvent}">
						<h:outputText value="#{rciBookingEntry.rciBulkBank.year}"></h:outputText>
					</h:commandLink>
					<f:param id="rciBookingEntryId" value="#{rciBookingEntry.rciBookingEntryId}" />
				</rich:column>	

				<rich:column style="text-align:center;width:5%;">
					<f:facet name="header">
						<h:outputText value="#{messages['week']}"></h:outputText>
					</f:facet>
				
					<h:commandLink action="#{adminRCIBean.navUpdateRCIBookingEntryAction}" actionListener="#{adminRCIBean.navUpdateRCIBookingEntryActionEvent}">
						<h:outputText value="#{rciBookingEntry.rciBulkBank.week}"></h:outputText>
					</h:commandLink>
				</rich:column>	
	
   			   <rich:column style="text-align:center;width:10%;">
					<f:facet name="header">
						<h:outputText value="#{messages['rci.type']}"></h:outputText>
					</f:facet>
				
					<h:commandLink action="#{adminRCIBean.navUpdateRCIBookingEntryAction}" actionListener="#{adminRCIBean.navUpdateRCIBookingEntryActionEvent}">
						<h:outputText value="#{rciBookingEntry.rciType}"></h:outputText>
					</h:commandLink>
				</rich:column>	

				<rich:column style="text-align:center;width:20%;">
					<f:facet name="header">
						<h:outputText value="#{messages['full.name']}"></h:outputText>
					</f:facet>
				
					<h:commandLink action="#{adminRCIBean.navUpdateRCIBookingEntryAction}" actionListener="#{adminRCIBean.navUpdateRCIBookingEntryActionEvent}">
						<h:outputText value="#{rciBookingEntry.rciMemberFullName}"></h:outputText>
					</h:commandLink>
				</rich:column>	
				
				<rich:column style="text-align:center;width:15%;">
					<f:facet name="header">
						<h:outputText value="#{messages['check.in.date.label']}"></h:outputText>
					</f:facet>
				
					<h:outputText value="#{rciBookingEntry.rciCheckInDate}">
						<f:convertDateTime pattern="dd/MM/yyyy" timeZone="Asia/Kuala_Lumpur"/>
					</h:outputText>
				</rich:column>

				<rich:column style="text-align:center;width:15%;">
					<f:facet name="header">
						<h:outputText value="#{messages['check.out.date.label']}"></h:outputText>
					</f:facet>
				
					<h:outputText value="#{rciBookingEntry.rciCheckOutDate}">
						<f:convertDateTime pattern="dd/MM/yyyy" timeZone="Asia/Kuala_Lumpur"/>
					</h:outputText>
				</rich:column>

				<rich:column style="text-align:center;width:15%;">
					<f:facet name="header">
						<h:outputText value="#{messages['status']}"></h:outputText>
					</f:facet>
				
					<h:outputText value="#{rciBookingEntry.status}">
					</h:outputText>
				</rich:column>
			</rich:dataTable>
		</h:panelGroup>
		
		<rich:datascroller align="left"  for="data" maxPages="20" />
		
		<t:panelGrid columns="2" columnClasses="standardTable_ColumnLeft_20,standardTable_ColumnLeft_80" width="100%">
			<h:outputText></h:outputText>
			<h:panelGrid columns="2">
				<h:commandButton value="#{messages['add.rci.booking.entry']}" action="#{adminRCIBean.navAddRCIBookingEntryAction}" 
					actionListener="#{adminRCIBean.navAddRCIBookingEntryActionListener}" styleClass="button">
				</h:commandButton>
				
				<h:commandButton value="#{messages['remove.rci.booking.entry']}" action="#{adminRCIBean.deleteRCIBookingEntryAction}" 
					actionListener="#{adminRCIBean.deleteRCIBookingEntryActionListener}" onclick="#{messages['delete.msg.alert']}" styleClass="button">
				</h:commandButton>
			</h:panelGrid>
		</t:panelGrid>
	</h:panelGrid>
	
</rich:panel>	